The processing or analysis of data packets can yield useful information regarding the source and/or the destination of the data packets; more generally, using all the packet header fields as well as the content of the data packets, appropriate action may be taken, if deemed necessary. In particular, data packet analysis may be used for data packet classification, measurement of variables contained in the data packets so as to extract information from the data packets, and detection of anomalies in the data packets.
A traditional implementation technique for stateful packet processing is to use a flow table in which, for every data packet or group of data packets being transmitted through a communications network, there is a corresponding entry in the flow table. The flow table may include data strings associated with the data packets being transmitted, and thus may be memory inefficient. The use of flow tables may be particularly problematic when a data packet (or a plurality of data packets) needs to be examined to see whether it matches a plurality of disparate conditions. In addition, flow tables may be relatively inflexible, with a user generally not being able to easily modify the rules associated with the flow tables.